package team.szm.scd.database.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import team.szm.scd.database.entity.InspectionType;

import java.util.List;

@Repository
public interface InspectionTypeMapper extends BaseMapper<InspectionType> {
    @Select("select iid as id, iname as name, iprice as price\n" +
            "from inspection_type \n" +
            "where iid in (" +
            "       select iid \n" +
            "       from ins_case_have \n" +
            "       where cid = ${caseId}" +
            ")")
    List<InspectionType> fromCaseId(@Param("caseId") String caseId);
}
